import http from '@/services/http';

export function getList<T>(params: Requestor.ListRequestParams) {
  return http.post<Requestor.ListResponse<T>>('/api/admin/SysMenu/list', {
    data: params,
  });
}
export function getAllList<T>() {
  return http.get<Requestor.Response<T>>('/api/admin/SysMenu/all/list');
}
export function getOneList<T>() {
  return http.get<Requestor.Response<T>>('/api/admin/SysMenu/one/list');
}
export function getInfo<T>(params: MenuManagementApi.InfoParams) {
  return http.get<Requestor.Response<T>>('/api/admin/SysMenu/get/info', {
    params,
  });
}
export function create(params: MenuManagementApi.CreateParams) {
  return http.post<Requestor.TeamplateResponse>('/api/admin/SysMenu/create', {
    data: params,
  });
}
export function update(params: MenuManagementApi.UpdateParams) {
  return http.post<Requestor.TeamplateResponse>('/api/admin/SysMenu/update', {
    data: params,
  });
}
export function remove(params: MenuManagementApi.DeleteParams) {
  return http.post<Requestor.TeamplateResponse>('/api/admin/SysMenu/delete', {
    data: params,
  });
}

export function getRelation(params: MenuManagementApi.GetRelationParams) {
  return http.get<Requestor.Response<MenuManagementApi.GetRelationResponse[]>>(
    '/api/admin/SysMenu/get/serrolerelationship',
    {
      params,
    },
  );
}
export function postRelation(params: MenuManagementApi.PostRelationParams) {
  return http.post<Requestor.TeamplateResponse>('/api/admin/SysMenu/sumbit/serrolerelationship', {
    data: params,
  });
}
